import cv2 as cv


def main():
    img = cv.imread('../data/test.png')
    if img is None:
        print("牛爷爷, 俺滴图图呢")
        exit(0)

    cv.imshow("Press Q to exit", img)

    print('图像形状[宽,高,通道数]:', img.shape)
    print('图像总像素数:', img.size, '计算值(宽×高×通道):', img.shape[0] * img.shape[1] * img.shape[2])
    print('图像数据类型:', img.dtype)

    while True:
        if cv.waitKey(0) == ord('q'):
            break

    cv.destroyAllWindows()


if __name__ == "__main__":
    main()
